function wholeramp=f_getRamp(ramplength,dur,FS)

dt = 1/FS;
tsig = dt:dt:dur;


rampts = ramplength * FS;
steadypts = round( dur * FS - 2*rampts);
totalpts = steadypts + (rampts*2);

% WAVEFORM ENVELOPE - On/off ramps
step = pi/(rampts-1);
x=[0:step:pi];
% offramp = (1+cos(x))./2;  % Cos^2 ramp is used
offramp = 1:(-1/length(x)):(1/length(x));  % linear
% onramp = (1+cos(fliplr(x)))./2; %Cos2
onramp = fliplr(offramp); % linear
o=ones(1,steadypts);
wholeramp = [onramp o offramp]; % Envelope for stimulus (i.e. on/off ramps)
